#ifndef __SJA1000_REG_H
#define __SJA1000_REG_H

/*Common register map*/
#define COMM_CTRL       0x00	//control
#define COMM_CMD        0x01	//command
#define COMM_STATUS     0x02	//status
#define COMM_BUSTIME0   0x06	//bus timing 0
#define COMM_BUSTIME1   0x07	//bus timing 1
#define COMM_OUTCTRL    0x08	//output control
#define COMM_CLKDIV     0x1f	//clock divider

/*COMM_CTRL bits*/
#define COMM_CTRL_RST   0x01	//reset request

/*BasicCAN mode register map*/
#define BCAN_CTRL       0x00	//control
#define BCAN_CMD        0x01	//command
#define BCAN_STATUS     0x02	//status

/*PeliCAN mode register map*/
#define PCAN_MODE       0x00	//mode
#define PCAN_CMD        0x01	//command
#define PCAN_STATUS     0x02	//status
#define PCAN_INT        0x03	//interrupt
#define PCAN_BUSTIME0  	0x06	//bus timing 0
#define PCAN_BUSTIME1  	0x07	//bus timing 1
#define PCAN_OUTCTRL    0x08	//output control
#define PCAN_TEST       0x09	//test
#define PCAN_ALC        0x0B	//arbitration lost capture
#define PCAN_ECC        0x0C	//error code capture
#define PCAN_EWL        0x0D	//error warning limit
#define PCAN_REC        0x0E	//RX error counter
#define PCAN_TEC        0x0F	//TX error counter
#define PCAN_ACPCODE    0x10	//acceptance code base
#define PCAN_ACPMASK    0x14	//acceptance mask base
#define PCAN_FRAMEINF   0x10	//RX & TX frame information
#define PCAN_ID         0x11	//identifier base
#define PCAN_SFFDATA    0x13  //standard frame format data base
#define PCAN_EFFDATA    0x15	//extended frame format data base
#define PCAN_RMSGCNT    0x1D	//RX message counter
#define PCAN_RBUFADDR   0x1E	//RX buffer start address
#define PCAN_CLKDIV     0x1F	//clock divider

/*PCAN_STATUS bits*/
#define PCAN_STATUS_RBS 0x01  //receive buffer status
#define PCAN_STATUS_DOS 0x02  //data overrun status
#define PCAN_STATUS_TBS 0x04  //transmit buffer status
#define PCAN_STATUS_TCS 0x08  //transmit complete status
#define PCAN_STATUS_RS  0x10  //receive status
#define PCAN_STATUS_TS  0x20  //transmit status
#define PCAN_STATUS_ES  0x40  //error status
#define PCAN_STATUS_BS  0x80  //bus status

#endif